package com.whu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.whu.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Dd
 * @date 2020/11/12 - 20:02
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    //插入一条用户信息
    @Insert("insert into user_login(user_name,user_password) value(#{name},#{password})")
    int insertUser(@Param("name") String name, @Param("password") String password);

    @Select("select * from user_login where user_name=#{name} and user_password=#{password}")
    List<User> selectUser(@Param("name") String name, @Param("password") String password);


}
